# planting_records/urls.py
from django.urls import path
from . import views

app_name = 'planting_records'

urlpatterns = [
    # List all records for the user
    path('', views.PlantingRecordListView.as_view(), name='record_list'),
    # List records filtered by a specific field
    path('field/<int:field_id>/', views.PlantingRecordListView.as_view(), name='record_list_by_field'),
    # Add a new record (general)
    path('add/', views.PlantingRecordCreateView.as_view(), name='record_add'),
    # Add a new record pre-filled for a specific field
    path('add/field/<int:field_id>/', views.PlantingRecordCreateView.as_view(), name='record_add_for_field'),
    # Detail view for a specific record
    path('<int:pk>/', views.PlantingRecordDetailView.as_view(), name='record_detail'),
    # Edit view
    path('<int:pk>/edit/', views.PlantingRecordUpdateView.as_view(), name='record_edit'),
    # Delete view
    path('<int:pk>/delete/', views.PlantingRecordDeleteView.as_view(), name='record_delete'),
]